package com.soft.line.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserInfo {

    private Integer id;

    @ApiModelProperty(value = "用户名")
    @NotNull(message = "用户名不能为空")
    @Length(min=4,max = 20,message="用户名长度不能小于4位，且不能大于20位")
    private String userName;

    @ApiModelProperty(value = "密码")
    //@NotNull(message = "密码不能为空")
    @Length(min=6,max=32,message="密码长度不能小于6位,且不能大于32位")
    private String password;

    @ApiModelProperty(value = "电话")
    @NotNull(message = "电话不能为空")
    @Pattern(regexp = "1[3|4|5|7|8][0-9]\\d{8}")
    private String phone;

    private String modifyPerson;

    private Date modifyTime;

    private String headImgUrl;

    @ApiModelProperty(value = "状态")
    @NotNull(message = "状态不能为空")
    private String userStatus;

    @ApiModelProperty(value = "角色")
    @NotNull(message = "角色不能为空")
    private Integer roleId;

    private String salt;

    private String openId;

    @ApiModelProperty(value = "部门ID")
    @NotNull(message = "部门ID为空")
    private String depId;

}